#include "Ogre.h"
#include "GameEngine.h"
#include "GameApp.h"
#include "GameInfo.h"
#include "Actor.h"
#include "Avatar.h"

class COverGameInfo : public CGameInfo
{
public:
	COverGameInfo()
	{
		mPlayer = NULL;
	}

	virtual ~COverGameInfo()
	{
	}

	virtual void onLoad()
	{
		mPlayer = new CAvatar;
	}

	virtual void onUnload()
	{
		delete mPlayer;
	}

	virtual void tick(Ogre::Real delta)
	{
	}

private:
	CAvatar* mPlayer;
};

class COverGameApp : public CGameApp
{
public:
	COverGameApp()
	{
		mGameInfo = new COverGameInfo;
	}

	virtual ~COverGameApp()
	{
		delete mGameInfo;
	}

	virtual const char* getGameName()
	{
		return "OverGame";
	}

	virtual void initResource()
	{
		CGameEngine::getSingletonPtr()->addResourceLocation("Sinbad.zip", "Zip");
		CGameEngine::getSingletonPtr()->addResourceLocation("Man", "FileSystem");
	}

	virtual void onEngineInited()
	{
		setGameInfo(mGameInfo);
	}

private:
	COverGameInfo* mGameInfo;
};
static COverGameApp mGameApp;

CGameApp* CGameApp::Singleton()
{
	return &mGameApp;
}
